#ifndef JTSDATA_H
#define JTSDATA_H

#include <QObject>
#include <QVector3D>
#include <QQuaternion>
#include <QTableWidget>

const enum PoseFormat
{
	JT_EULER_312 = 312
};

class Pose: public QObject
{
	Q_OBJECT

public:
	Pose(float *loc, float *rot, int format)
	{
		for (int n=0; n < 3; ++n) {
			_loc[n] = loc[n];
			_rot[n] = rot[n];
		}
		_format = format;
	}

private:
	float _loc[3];
	float _rot[3];
	int _format;
};

struct PoseEntry
{
	QVector3D trans;
	QVector3D rot;
	QQuaternion quat;
};

class JTSData : public QObject
{
	Q_OBJECT

public:
	JTSData(const QString& filename);
	~JTSData();

public slots:
	int size();
	const PoseEntry& data(int index);
	void display();

private slots:
	void loadFromFile(const QString& filename);

private:
	void toQuaternion312(float z_rot, float x_rot, float y_rot, float* rotation);

	QList<PoseEntry> m_Data;
	int m_nSize;
	int m_Format;
	QTableWidget* m_pTable;
};

#endif // JTSDATA_H
